from django.db import models
from utils.models import CoreModel

# Create your models here.

class Article(CoreModel):
    article_title = models.CharField(max_length=255, null=True, blank=True, verbose_name="文章标题", help_text="文章标题")
    article_cover = models.CharField(max_length=255, null=True, blank=True, verbose_name="文章封面", help_text="文章封面")
    article_content = models.TextField(null=True, blank=True, verbose_name="文章内容", help_text="文章内容")
    DEL_TYPE = (
        (0, "否"),
        (1, "是"),
    )
    is_delete = models.IntegerField(choices=DEL_TYPE, default=0, verbose_name="是否删除", help_text="是否删除")
    STATUS_TYPE = (
        (1, "公开"),
        (2, "私密"),
        (3, "评论可见"),
    )
    status = models.IntegerField(choices=STATUS_TYPE, default=1, verbose_name="状态", help_text="状态")

    class Meta:
        db_table = 't_article'
        verbose_name = '文章'
        verbose_name_plural = verbose_name
        ordering = ('-create_time',)
        
class Ziyuan(CoreModel):
    name = models.CharField(max_length=255, null=True, blank=True, verbose_name="资源名称", help_text="资源名称")
    weblink = models.CharField(max_length=255, null=True, blank=True, verbose_name="资源链接", help_text="资源链接")
    default_passcode = models.CharField(max_length=255, null=True, blank=True, verbose_name="密码", help_text="密码")
    DEL_TYPE = (
        (0, "否"),
        (1, "是"),
    )
    is_del = models.IntegerField(choices=DEL_TYPE, default=0, verbose_name="是否删除", help_text="是否删除")
    
    class Meta:
        db_table = 't_ziyuan'
        verbose_name = '资源'
        verbose_name_plural = verbose_name
        ordering = ('-create_time',)        